import request from '@/router/axios';

//1.获取authURL email,password
export const getAuthURL = (row) => {
  return request({
    url: '/api/blade-social/facebook/authUrl',
    method: 'get',
    params: row
  })
}
//通过 URL 获取 code
//2. 通过 authURL 获取 code
//2.绑定账户 - code,accountEmail
export const bindEmail = (code,accountEmail) => {
  return request({
    url: `/api/blade-social/facebook/bind?code=${code}&accountEmail=${accountEmail}`,
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
  })
}
//3.获取account - accountEmail
export const getAccount = (accountEmail) => {
  return request({
    url: `/api/blade-social/facebook/account?accountEmail=${accountEmail}`,
    method: 'get'
  })
}
//4.绑定account - account
export const bindAccount = (id,accessToken,accountEmail) => {
  return request.put(`/api/blade-social/facebook/account?id=${id}&accessToken=${accessToken}&accountEmail=${accountEmail}`)
}
